//
// Created by 王乐 on 2022/2/17.
//

#include "LeFireBehaviour.h"

#include "LeParticleGameObject.h"
#include "LeParticleSystem.h"

#include "LeInput.h"
#include "LeTime.h"

LeFireBehaviour::LeFireBehaviour()
{}

LeFireBehaviour::~LeFireBehaviour()
{

}

void LeFireBehaviour::Start()
{
    m_FireIntervalTime = 0.1;
    m_CurTime = 0;
}

void LeFireBehaviour::Update()
{
    m_CurTime += LeTime::dDeltaTime;
    if(m_CurTime > m_FireIntervalTime)
    {
        m_CurTime = 0;
        LeParticle partDef(std::string("MyDust"), 1.2, glm::vec3(0,0.3,0), 0.0, -0.1,
                           "/Users/wangle/CLionProjects/Leste/res/dust.png");
        m_pParticleSystem->emitParticles(2, partDef,
                                         glm::vec3(0, 0, 0),
                                         glm::vec3(-0.15, -0.1, 0), glm::vec3(0.15, 0.1, 0),
                                         glm::vec2(0, 0),
                                         glm::vec3(0.1, 0.1, 0.1), glm::vec3(0.1, 0.1, 0.1));
    }
}
